package 静态内部类;

public class out {
    private static String name;
    private static int age;

    public static String getName() {
        return name;
    }

    public static void setName(String name) {
        out.name = name;
    }

    public static int getAge() {
        return age;
    }

    public static void setAge(int age) {
        out.age = age;
    }

    public static class in{
        private String name;
        public void s(){
            //优先输出内部自己的变量
            System.out.println(name);
            //如果内部类没有变量会使用外部的静态变量如果要直接使用可以用外部类调用
            System.out.println(age);
            System.out.println(out.name);
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

}
